srinivas rallabandi
Install and Configure SonarQube and Gradle Plugins
1h 19m 35s left
Introduction
In this Lab Step, you will continue using the Jenkins administration web console. You will now install the Gradle and SonarQube Scanner plugins, required to perform a build and static code analysis. You will configure the SonarQube Scanner plugin to authenticate against SonarQube using the security token you generated in the previous Lab Step.
Instructions
Install SonarQube Scanner Plugin
1. Click on the Manage Jenkins menu item taking you into the Manage Jenkins screen. Ignore any update and/or security messages that Jenkins may announce as this is a Lab environment only:
2. Click on the Manage Plugins menu item taking you into the Plugin Manager:
3. Click the Available tab and enter SonarQube within the search input field associated with the Plugins Manager pane. Select the SonarQube Scanner option and click Install without restart:
4. Ensure that the SonarQube Scanner plugin has been installed successfully as per the Success status at the bottom of the plugins list and click Go back to the top page:

5. Click on the Manage Jenkins > Global Tool Configuration menu item:
6. Under SonarQube Scanner, click Add SonarQube Scanner. Enter sonar in the Name field and ensure that the Install automatically checkbox is ticked. Then select the SonarQube Scanner 3.2.0.1227 version under Install from Maven Central. Click Apply to commit the SonarQube Scanner plugin installation settings:

Install Gradle Plugin
7. Staying on the Global Tool Configuration screen, scroll back up. Under Gradle, click Add Gradle. Enter gradle-4.10.2 in the Name field and ensure the Install automatically checkbox is ticked. Then select the Gradle 4.10.2 version under Install from Gradle.org. Click Apply to commit the Gradle plugin installation settings:
8. Click Save and return to the Jenkins home page by clicking the Jenkins logo:
Configure SonarQube Credentials
9. Click Credentials to be taken into the Credentials screen:
10. Hover over and click the _(global) link, then click the Add credentials context menu item:
11. Set Kind to Secret text, and ensure that the Scope is set to Global, then set:
Secret: Enter the secret token value you generated in the SonarQube application in the previous Lab Step
ID:
sonar
Description:
sonar
12. Click OK to commit the SonarQube secret token into the Jenkins credentials secured storage area. Finally, return to the Jenkins home page by clicking the Jenkins logo:

Summary
In this Lab Step, within the Jenkins administration web console, you installed and configured the SonarQube Scanner and Gradle plugins. Finally, you configured the SonarQube credential security token, securely storing it within Jenkins. In the next Lab Step, you will configure a build-and-test pipeline that leverages both of these plugins.








